package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.ExtIotDevice;
import com.econ.powercloud.ems.dal.mapper.ExtIotDeviceMapper;
import com.mysql.cj.util.StringUtils;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2022/3/11 15:17
 * @Modified by : zjf
 */
@Repository
public class ExtIotDeviceDAO extends ServiceImpl<ExtIotDeviceMapper, ExtIotDevice> {

    public List<ExtIotDevice> selectListByPids(List<Integer> pids) {
        LambdaQueryWrapper<ExtIotDevice> wrapper = Wrappers.lambdaQuery();
        wrapper.in(CollectionUtils.isNotEmpty(pids), ExtIotDevice::getPid, pids);
        return this.baseMapper.selectList(wrapper);
    }
}
